import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import router from './router'
import store from './store'

// 导入全局样式
import 'assets/css/global.css'
// 导入字体文件
import 'assets/fonts/iconfont.css'

// 导入ajax
import axios from 'axios'
Vue.prototype.$http = axios;

// 配置基准地址
axios.defaults.baseURL = "http://127.0.0.1:8888/api/private/v1/";

// 请求拦截器
axios.interceptors.request.use(config=>{
  // 将请求头发送出去
  config.headers.Authorization = window.sessionStorage.getItem('token');
  return config
})

Vue.config.productionTip = false
Vue.use(ElementUI);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
